package com.bbms.service.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.bbms.dao.BookDAO;
import com.bbms.entity.Book;
import com.bbms.entity.Page;
import com.bbms.service.BookService;

@Service("BookServiceImpl")
public class BookServiceImpl implements BookService {
	
	@Resource(name="BookDAOImpl")
	private BookDAO dao;
	
	@Override
	public void add(Book t) {

	}

	/* 详细图书信息更新
	 * @see com.bbms.service.BaseService#update(java.lang.Object)
	 */
	@Override
	public void update(Book t) {
		dao.update(t);
	}

	/* 详细图书信息删除
	 * @see com.bbms.service.BaseService#delete(java.lang.Object)
	 */
	@Override
	public void delete(Book t) {
		dao.delete(t);
	}

	@Override
	public Page getPage(int currentPage, int pageSize) {
		Page page = dao.getPage(currentPage, pageSize);
		return page;
	}

	/* 批量删除
	 * @see com.bbms.service.BookService#addBatch(com.bbms.entity.Book, int)
	 */
	@Override
	public void addBatch(Book book, int booksNum) {
		dao.addBatch(book, booksNum);
	}

	/* 批量删除
	 * @see com.bbms.service.BookService#delBatch(com.bbms.entity.Book)
	 */
	@Override
	public void delBatch(Book book) {
		dao.delBatch(book);
	}

	/* 批量更新
	 * @see com.bbms.service.BookService#updateBatch(com.bbms.entity.Book)
	 */
	@Override
	public void updateBatch(Book book) {
		dao.updateBatch(book);
	}

	/* 图书查询分页信息
	 * @see com.bbms.service.BookService#getPage(int, int, java.lang.String, java.lang.String, java.lang.Integer, java.lang.Integer, java.lang.String, java.lang.String)
	 */
	@Override
	public Page getPage(int currentPage, int pageSize, String s_name, String s_author, Integer s_publisherId,
			Integer s_categoryId, String start_time, String end_time, int authority) {
		
		Page page = dao.getPage(currentPage, pageSize, s_name, s_author, s_publisherId, s_categoryId, start_time, end_time, authority);
		
		return page;
	}

	/* 图书详细信息
	 * @see com.bbms.service.BookService#getDetail(java.lang.String, java.lang.String)
	 */
	@Override
	public List<?> getDetail(String publishDate, String ISBN, int authority) {

		List<?> list = dao.getDetailList(publishDate, ISBN, authority);
		return list;
	}

}
